<div class="inside">
  <aside class="navigationPanel">
     
     <div class="tree pagesLinks">
        <ul>
           <ul>
              <li> <a href="<?php echo $baseurl.'campaign-user.html'?>" class="active">Chiến dịch của bạn</a> </li>                      
              <li> <a href="<?php echo $baseurl.'add-campaign-user.html'?>">Tạo chiến dịch mới</a> </li>
               <li> <a href="<?php echo $baseurl.'history-trade.html'?>">Lịch sử giao dịch</a> </li>
           </ul>
        </ul>
     </div>
  </aside>
  <div class="contentPanel">
     <div class="pages" id="profile">
        <div class="profile-edit-form">
            <div class="contentBox switcher">
                 <h3>Danh sách chiến dịch của bạn</h3>
                 <div class="contentSwitcher hide" style="display: block;">
                    <div class="insideContentBox">
                          <div class="wicity">
                    			<table >
                                            <thead>
                                                <tr> 
                    					<td style="width: 5%;">
                    						STT
                    					</td>
                    					<td >
                    						Tên chiến dịch
                    					</td>
                    					<td>
                    						Đại lý
                    					</td>
                                        <td style="">
                    						Thời gian chạy chiến dịch
                    					</td>
                                        <td>
                    						Trạng thái
                    					</td>
                                        <td colspan="2">
                    						Tác vụ
                    					</td>
                    				</tr>
                                            </thead>
                                    
                                      
                                            <tbody>
                                                <?php if ( $page == 0 ){ $page = 1;} 
                                                    $stt= $per_page*($page - 1) +1;
                                                    //echo $stt; ?>
									<?php $i = 1; foreach ( ($data['data']) AS $el=>$le ){ ?>
                                    <tr> 
                    					<td style="width: 10%;">
                    						<?php echo $stt;?>
                    					</td>
                    					<td >
                    						<?php echo $le->title;?>
                    					</td>
                    					<td>
                    						<?php echo $le->agency_fullname;?>
                    					</td>
                                        <td>
                    						<?php echo $fview->convertTimeRunCampaign($le->time_start).'<br/>'.$fview->convertTimeRunCampaign($le->time_end);?>
                    					</td>
                                        <td>
                    						<?php echo $fview->status_campaign($le->active);?>
                    					</td>
                                        <td>
										<?php if( $le->active == 1 || $le->active == 2 ){?>
                    						<a href="<?php echo $baseurl;?>campaign-user-detail/<?php echo $le->id; ?>">
											Chi tiết</a>
											<?php }else{ ?>
											<a href="<?php echo $baseurl;?>edit-campaign-user/<?php echo $le->id; ?>">
											Sửa</a>
											<?php }?>
											
                    					</td>
                                        <td>
                    						<span class="delete-campaign-user" id="<?php echo $le->id; ?>" >Xóa</span>
                    					</td>
                    				</tr>
									<?php $stt++; } ?>
                                  
                                            </tbody>
                    			</table>
                    		</div>
                              <div class="pagination">
                                <?php echo $this->pagination->create_links();?> 
                            </div> 
                    </div>
                 </div>
            </div>
        </div>
     </div>
  </div>
</div> 
<style>
body.flash-permanent .contentPanel {
padding: 100px 0px 18px !important;
}
.admin .contentBox .insideContentBox {
background: white;
padding: 26px 0px !important;
}
.delete-campaign-user{
	cursor: pointer;
}
</style>
<script>
$('.delete-campaign-user').click(function() {
	var id = this.id;
	var r = confirm("Bạn có chắc chắn xóa chiến dịch này?");
	if (r == true) {
		location.href = "<?php echo $baseurl;?>delete-campaign-user/"+id;		
	} 
});
</script>